local EHeal = EHeal


local function GetArgs(text, separator)
	local args = {}
	local i = 0
	for value in string.gmatch(text, "[^"..separator.."]+") do
		i = i + 1
		args[i] = value
	end	
	return args
end

function EHeal_SlashHandler(msg)
	local msgargs = GetArgs(msg," ");
	if (msg=="") then

	end

	if (msgargs[1]=="test") then
		EHeal_UpdateUnitDetails("player");
	end
		
	if (msg=="open") or (msg=="show") then
		EHealPlayerFrame:Show();
	end
	
	if (msg=="close") or (msg=="hide") then
		EHealPlayerFrame:Hide();
	end
end

function EHeal_UpdateUnitDetails(unit)
	local class = select(2, UnitClass(unit))
	if class then
		EHealPlayerFrameteststring:SetText(UnitName(unit))
		local color = RAID_CLASS_COLORS[class]
		EHealPlayerFrameteststring:SetTextColor(color.r, color.g, color.b, 1)
	else
		EHealPlayerFrameteststring:SetText(UnitName(unit) or L["Unknown"])
	end
end






--[[
function sRaidFrames:UpdateUnitDetails(unit)
	if not self:IsTracking(unit) then return end
	for _, f in pairs(self:FindUnitFrames(unit)) do
		local class = select(2, UnitClass(unit))
		if class then
			f.title:SetText(UnitName(unit))

			local color = RAID_CLASS_COLORS[class]
			f.title:SetTextColor(color.r, color.g, color.b, 1)
		else
			f.title:SetText(UnitName(unit) or L["Unknown"])
		end
	end
end

function sRaidFrames:UpdateUnitHealth(unit)
	if not self:IsTracking(unit) then return end
	for _, f in pairs(self:FindUnitFrames(unit)) do
		local status, dead, ghost = nil, UnitIsDead(unit), UnitIsGhost(unit)

		if not UnitIsConnected(unit) then status = "|cffff0000"..L["Offline"].."|r"
		elseif self.res[unit] == 1 and dead then status = "|cffff8c00"..L["Can Recover"].."|r"
		elseif self.res[unit] == 2 and (dead or ghost) then status = "|cffff8c00"..L["Resurrected"].."|r"
		elseif ghost then status = "|cffff0000"..L["Released"].."|r"
		elseif dead then status = "|cffff0000"..L["Dead"].."|r"
		end

		if status then
			f.hpbar.text:SetText(status)
			f.hpbar:SetValue(0)
			f.mpbar:SetValue(0)
			self:SetStatus(unit, "Death")
		else
			self:UnsetStatus(unit, "Death")
			self.res[unit] = nil
			local hp = UnitHealth(unit) or 0
			local hpmax = UnitHealthMax(unit)
			local hpp = (hpmax ~= 0) and ceil((hp / hpmax) * 100) or 0
			local hptext, hpvalue = nil, nil

			local format = self.opt.HealthFormat
			if format == "percent" then
				hptext = hpp .."%"
			elseif format == "deficit" then
				hptext = (hp-hpmax) ~=  0 and (hp-hpmax) or nil
			elseif format == "current" then
				hptext = hp
			elseif format == "curmax" then
				hptext = hp .."/".. hpmax
			elseif format == "curdeficit" then
				hptext = (hp-hpmax) ~=  0 and  hp .." |cffff0000".. (hp-hpmax) or hpmax
			end

			if self.opt.Invert then
				hpvalue = 100 - hpp
			else
				hpvalue = hpp
			end

			f.hpbar.text:SetText(hptext)
			f.hpbar:SetValue(hpvalue)
			f.hpbar:SetStatusBarColor(self:GetHPSeverity(hpp/100))
		end
	end
end
--]]
